//
//  AppMacro.h
//  bgms_p
//
//  Created by xiao.zhao@lachesis-mh.com on 16/2/19.
//  Copyright © 2016年 xiao.zhao@lachesis-mh.com. All rights reserved.
//

#ifndef AppMacro_h
#define AppMacro_h

#define APP ((AppDelegate*)[UIApplication sharedApplication].delegate)

#define IOS8            ([[[UIDevice currentDevice] systemVersion] doubleValue] >= 8.0)

//==============Common==============
//主题颜色
#define kAppThemeColor [UIColor colorWithHexString:@"#ffffff"]
#define kAppBarColor [UIColor colorWithHexString:@"#1B1919"]
//背景颜色
#define kAppBackgroundColor [UIColor colorWithHexString:@"eff3f3"]
#define kAppLightBackgroundColor     [UIColor colorWithHexString:@"f2f2f2"]
//App黑色字体颜色
#define kAppNormalTextColor [UIColor colorWithHexString:@"#231916"]
#define kAppGrayTextColor [UIColor colorWithHexString:@"#030303"]
#define kAppSelectedColor [UIColor colorWithHexString:@"#f0f0f0"]
#define kAppSwitchOnCloor [UIColor colorWithHexString:@"161414"]
#define kAppGrayBgColor [UIColor colorWithHexString:@"cbcbcb"]
//App绿色字体颜色
#define kAppGreenTextColor [UIColor colorWithHexString:@"999999"]
//App灰色字体颜色
#define kAppLBlackTextColor [UIColor colorWithHexString:@"8c8c8c"]
//App画线颜色
#define kAppLinesColor [UIColor colorWithHexString:@"d8d8d8"]
#define kAppDeepLineColor     [UIColor colorWithHexString:@"3d3a3a"]
#define kAppLowChartColor [UIColor colorWithHexString:@"eb046b"]
#define kAppHighChartColor [UIColor colorWithHexString:@"ff9c00"]
#define kAppNormalChartColor [UIColor colorWithHexString:@"55cc05"]

/**
 *  颜色16进制
 */
#define UICOLOR_FROM_RGB_OxFF(rgbValue)     [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define UICOLOR_FROM_RGB_OxFF_ALPHA(rgbValue,al)     [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:al]
/**
 *  颜色RGB值
 */
#define UICOLOR_FROM_RGB(r,g,b)             [UIColor colorWithRed:(r/255.0) green:(g/255.0) blue:(b/255.0) alpha:1.0]
#define UICOLOR_FROM_RGB_ALPHA(r,g,b,al)             [UIColor colorWithRed:(r/255.0) green:(g/255.0) blue:(b/255.0) alpha:al]
//cell 边线颜色
#define CELL_LINE_COLOR             UICOLOR_FROM_RGB_OxFF(0xf1f3f3)
#define LABLE_BLACK_COLOR           UICOLOR_FROM_RGB_OxFF(0x1d1d26)
#define LABLE_GRAY_COLOR            UICOLOR_FROM_RGB_OxFF(0xa7a7a7)
#define LABLE_3_BLACK_COLOR         UICOLOR_FROM_RGB_OxFF(0x333333)
#define LABLE_6_GRAY_COLOR          UICOLOR_FROM_RGB_OxFF(0x666666)
#define LABLE_7_GRAY_COLOR          UICOLOR_FROM_RGB_OxFF(0x777777)
#define LABLE_MORE_LIGHT_GRAY_COLOR UICOLOR_FROM_RGB_OxFF(0xcccccc)
#define LABLE_LIGHT_GRAY_COLOR      UICOLOR_FROM_RGB_OxFF(0x999999)
#define RED_COLOR                   UICOLOR_FROM_RGB_OxFF(0xfa5758)
#define YELLOW_COLOR                UICOLOR_FROM_RGB_OxFF(0xfed604)
#define LABLE_BROWN                 UICOLOR_FROM_RGB_OxFF(0x6d4113)
#define BLUE_COLOR                  UICOLOR_FROM_RGB_OxFF(0x00a0f4)
#define VIEW_BACK_COLOR             UICOLOR_FROM_RGB_OxFF(0xf0f0f0)
#define GOODS_SELECT_COLOR          UICOLOR_FROM_RGB(241, 82, 83)

#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kScreenHeight [UIScreen mainScreen].bounds.size.height

#define kIphoneIs6P (kScreenWidth == 414)
#define kIphoneIs6 (kScreenWidth == 375)
#define kIphoneIs5 (kScreenWidth == 320)

#define kAppDidAssociateDeviceString @"didAssociateDevice"
#define kAppHeadUnitHeard @"heard"
#define kAppHeadUnitData @"headUnitData"
#define kLXUserTokenKey @"LXUserTokenKey"

#define NSStringFromInt(intValue) [NSString stringWithFormat:@"%d",intValue]
#define NSStringFromInteger(integerValue) [NSString stringWithFormat:@"%ld",integerValue]
#define NSStringFromFloat(floatValue) [NSString stringWithFormat:@"%f",floatValue]

#define TRANSFER_SERVICE_UUID           @"E20A39F4-73F5-4BC4-A12F-17D1AD07A96"
#define CSR_TRANSFER_SERVICE_UUID       @"00005500-D102-11E1-9B23-00025B00A5A5"
#define TRANSFER_CHARACTERISTIC_UUID    @"00005501-D102-11E1-9B23-00025B00A5A5"

#define SERVICE_UUID                       @"0000FFF0-0000-1000-8000-00805F9B34FB"
#define COMMON_CHARACTERISTIC_UUID         @"0000FFF1-0000-1000-8000-00805F9B34FB"
#define MUSIC_CHARACTERISTIC_UUID          @"0000FFF2-0000-1000-8000-00805F9B34FB"
#define LED_CHARACTERISTIC_UUID            @"0000FFF3-0000-1000-8000-00805F9B34FB"
#define AUX_CHARACTERISTIC_UUID            @"0000FFF4-0000-1000-8000-00805F9B34FB"
#define SOUNDS_CHARACTERISTIC_UUID         @"0000FFF5-0000-1000-8000-00805F9B34FB"
#define FM_CHARACTERISTIC_UUID             @"0000FFF6-0000-1000-8000-00805F9B34FB"
#define ALERN_CHARACTERISTIC_UUID          @"0000FFF6-0000-1000-8000-00805F9B34FB"
#define EQ_CHARACTERISTIC_UUID             @"0000FFFC-0000-1000-8000-00805F9B34FB"

#define TEST_SERVICE_UUID @"0000FA00-0000-1000-8000-00805F9B34FB"
#define TEST_CHARACTERISTIC_UUID @"0000FA01-0000-1000-8000-00805F9B34FB"

//===============enum myInfoType==================
typedef enum {
    boomCloseType = 1000,
    flashingType,
    solidColorType,
    beatMatchType,
    beatPulseType,
    beatStrobeType,
}LXBoomSelectType;

typedef enum {
    TopType = 1010,
    LeftType,
    BottomType,
    RightType
}LXPositionType;
#endif
